<template>
  <g-page>
    <u-button @click="$Router.push({name:'test1'})">test1</u-button>
    <u-button @click="login">login</u-button>
    <view>自定义图标</view>
    <view class="icon-box">
      <view class="icon" v-for="(name,index) in iconList" :key="index">
        <u-icon size="60" :name="name" custom-prefix="custom-icon" color="red"/>
        <view>{{ name }}</view>
      </view>
    </view>
    <view>uview内置图标</view>
    <u-icon size="60" name="phone"/>
    <view>自定义组件：组件明命规则，components/组件名/组件名.vue</view>
    <g-test/>
  </g-page>
</template>

<script>
import {wxLoginApi,passwordLoginApi} from "@api"
export default {
  name: "test",
  data(){
    return{
      iconList:['id-card-fill','certification','visit-fill','flag-fill','scale-fill','doctoral-cap','doctoral-cap-fill',
      'branch-fill','leader-fill','group-fill']
  }
  },
  onLoad(){
    //this.$Router.push({name:"login"})
  },
  methods:{
    /*login(){
      wxLoginApi({aa:1231})
      .then(res=>{
        console.log(res);
      })
      .catch(err=>{
        console.log(err);
      })
      .finally(res=>{
        console.log(res);
      })
    }*/
    async login(){
      let res = await wxLoginApi({aa:1231})
      console.log(res);
    }
  }
}
</script>

<style scoped lang="scss">
.icon{
  text-align: center;
  //border: 1px #dd524d solid;
  border-radius: 10rpx;
  margin: 20rpx;

  &-box{
    column-count:2
  }
}
</style>
